package logic;

public abstract class MetroCard {
	private CardType cardType;
	private long cardId;
	private PassChecker passChecker;
	
	public MetroCard(){
        }
        
        public long getCardId() {
		return cardId;
	}

	public final void setCardId(long number) {
		this.cardId = number;
	}

	public CardType getType() {
		return cardType;
	}
	
	public void setType( CardType type ) {
            this.cardType = type;
	}
        
        public PassChecker getPassChecker() {
		return passChecker;
	}

	public void setPassChecker(PassChecker passChecker) {
		this.passChecker = passChecker;
	}
			
        public boolean addMoney( double money){
            return false;
        }
        
        public boolean checkPass(){
            return passChecker.checkPass();
        }
        
	public String toString(){
		return getType() + " " + getCardId() + " ";
	}
	
	public boolean equals ( Object obj ){
		if ( obj != null && getClass() == obj.getClass() ){
			MetroCard other = (MetroCard) obj;
			return cardId == other.cardId;
		}
		return false;
	}

	
	
}
